package com.ruoyi.energize.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.energize.mapper.WdzDepartmentsMapper;
import com.ruoyi.energize.domain.WdzDepartments;
import com.ruoyi.energize.service.IWdzDepartmentsService;

/**
 * 万店掌门店列表Service业务层处理
 *
 * @author ruoyi
 * @date 2023-06-14
 */
@Service
public class WdzDepartmentsServiceImpl implements IWdzDepartmentsService
{
    @Autowired
    private WdzDepartmentsMapper wdzDepartmentsMapper;

    /**
     * 查询万店掌门店列表
     *
     * @param autoId 万店掌门店列表主键
     * @return 万店掌门店列表
     */
    @Override
    public WdzDepartments selectWdzDepartmentsByAutoId(Long autoId)
    {
        return wdzDepartmentsMapper.selectWdzDepartmentsByAutoId(autoId);
    }

    /**
     * 查询万店掌门店列表列表
     *
     * @param wdzDepartments 万店掌门店列表
     * @return 万店掌门店列表
     */
    @Override
    public List<WdzDepartments> selectWdzDepartmentsList(WdzDepartments wdzDepartments)
    {
        return wdzDepartmentsMapper.selectWdzDepartmentsList(wdzDepartments);
    }
    /**
     * 查询万店掌所有的id字符串，用于批量查询客流数据
     * @return
     */
    @Override
    public String selectWdzDepartmentsIds(){
        return wdzDepartmentsMapper.selectWdzDepartmentsIds();
    }
    /**
     * 新增万店掌门店列表
     *
     * @param wdzDepartments 万店掌门店列表
     * @return 结果
     */
    @Override
    public int insertWdzDepartments(WdzDepartments wdzDepartments)
    {
        if(wdzDepartments.getCreateTime()==null){
            wdzDepartments.setCreateTime(DateUtils.getNowDate());
        }
        return wdzDepartmentsMapper.insertWdzDepartments(wdzDepartments);
    }

    /**
     * 修改万店掌门店列表
     *
     * @param wdzDepartments 万店掌门店列表
     * @return 结果
     */
    @Override
    public int updateWdzDepartments(WdzDepartments wdzDepartments)
    {
        return wdzDepartmentsMapper.updateWdzDepartments(wdzDepartments);
    }

    /**
     * 批量删除万店掌门店列表
     *
     * @param autoIds 需要删除的万店掌门店列表主键
     * @return 结果
     */
    @Override
    public int deleteWdzDepartmentsByAutoIds(Long[] autoIds)
    {
        return wdzDepartmentsMapper.deleteWdzDepartmentsByAutoIds(autoIds);
    }

    /**
     * 删除万店掌门店列表信息
     *
     * @param autoId 万店掌门店列表主键
     * @return 结果
     */
    @Override
    public int deleteWdzDepartmentsByAutoId(Long autoId)
    {
        return wdzDepartmentsMapper.deleteWdzDepartmentsByAutoId(autoId);
    }
}
